<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>109_递归</title>
		<script>
			/* 
			编写递归函数，一定要包含两个要件:
				1.基线条件-递归的终止条件;
				2.递归条件 -如何对问题进行拆分.
			 */
			function jiecheng(num) {
				//基线条件
				if (num === 1) {
					return 1;
				}
				//递归条件
				//num! = (num-1)! * num
				return jiecheng(num - 1) * num;
			}
			let ret=jiecheng(4);
			console.log(ret);
		</script>
	</head>
	<body>
	</body>
</html>